#include <iostream>
#include <cstring>

using namespace std;
int main()
{
    char greeting[6] = {'H','e','l','l','o','\0'};
    cout << "Greeting message: ";
    char str1[11] = "Hello";
    char str2[11] = "World";
    char str3[11];
    int len;
    //copy str1 to str3;
    strcpy( str3, str1);
    cout << "strcpy( str3, str1) :" << str3 << endl;
    //connect str1 with str2
    strcat( str1, str2);
    cout << "strcat( str1, str2) :" << str1 << endl;
    //after connect out the len of str1
    len = strlen(str1);
    cout << "strlen( str1) :" << len << endl;
    return 0;
};
/*
 *来操作以null结尾的字符串
 *strcpy(s1,s2);复制字符串s2到s1
 *strcat(s1,s2);连接s2到s1的末尾
 *strlen(s1);返回字符串s1长度
 *strcmp(s1,s2);如果字符串s1s2等长返回0,如果s1<s2返回<0,如果s1>s2返回>0
 *strchr(s1,ch);返回一个指针，指向字符串s1中字符ch第一次出现的位置
 *strstr(s1,s2);返回一个指针，指向字符串s1中字符串s2第一次出现的位置
 */
